home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19990725-20000114
/
000209_news@columbia.edu _Mon Oct 18 00:56:29 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-01-13
|
3KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id AAA19217
for <kermit.misc@watsun.cc.columbia.edu>; Mon, 18 Oct 1999 00:56:28 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id AAA22760
for kermit.misc@watsun.cc.columbia.edu; Mon, 18 Oct 1999 00:55:55 -0400 (EDT)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
Subject: [Q] how to take an action on closing network connection OR redefine a command
From: Matt Swift <swift@alum.mit.edu>
Message-ID: <m2ln91jmj0.fsf@aleph.swift.xxx>
Date: 18 Oct 1999 00:55:15 -0400
Organization: Shore.Net/Eco Software, Inc; (info@shore.net)
To: kermit.misc@columbia.edu
I want to use kermit to telnet to certain remote hosts via a local
port forwarded by ssh ("tunnelling"). Suppose I want to telnet to my
isp at shell.isp.com, and suppose I've defined `login' as a kermit
macro which supplies user and password. This macro would bring up a
normal, insecure connection:
define isp -
set host shell.isp.com,-
login,-
connect
Now I want to redefine `isp' so that I can use it in the same way but
it uses the tunelling method. Suppose I write a shell script `tunnel'
that will establish the tunnel before exiting.
define isp,-
run tunnel start isp,-
set host localhost:9000 /telnet,-
login,-
connect
This works just fine, except that the tunnel must be shut down
manually. I would like to improve this macro so that the tunnel will
be closed (by taken the action `run tunnel stop isp') automatically
when kermit closes the connection. I do not see that there is any
direct way to do this with kermit, so I thought of redefining
the `close' command. Unfortunately it does not seem possible. I tried:
assign close-orig close
define close -
echo a message,-
close-orig
After this, `close' from the kermit prompt executes the command
`close' as usual. It does not execute the macro `close' that I just
defined. If I do this:
define my-close -
echo a message,-
close-orig
typing `my-close' from the kermit prompt works as expected. But this
is not elegant or convenient IMO.
I would much appreciate any advice on how to arrange that kermit will
take a definable action when a network connection is closed with
`close' -- or, prefereably, when it is closed for whatever reason, but
I though that this was a bit too ambitious to try to accomplish.